<?php

use Illuminate\Database\Seeder;

class AdminMenuTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        /*
         * 排序
         * 升序排序
         */
        $order = [
            'index'         =>      0,  //控制面板
            'adminMange'    =>      4,  //后台管理
            'member'        =>      3,  //用户管理
            'me'            =>      1,  //我的面板
            'shop'          =>      2,  //商城
        ];
        $data = [
            /*
             * 仪表盘
             */
            [
                'id'            =>      1,
                'name'          =>      '首页',
                'parentID'      =>      0,
                'controller'    =>      'Admin\IndexController@index',
                'listOrder'     =>      $order['index'],
                'display'       =>      1,
                'icon'          =>      'fa fa-dashboard'
            ],
            /*
             * 后台管理
             */
            [
                'id'            =>      2,
                'name'          =>      '后台管理',
                'parentID'      =>      0,
                'controller'    =>      '',
                'listOrder'     =>      $order['adminMange'],
                'display'       =>      1,
                'icon'          =>      'fa fa-th-large'
            ],
            [
                'id'            =>      3,
                'name'          =>      '目录管理',
                'parentID'      =>      2,
                'controller'    =>      'Admin\MenuController@getIndex',
                'listOrder'     =>      0,
                'display'       =>      1,
                'icon'          =>      ''
            ],
            [
                'id'            =>      4,
                'name'          =>      '添加目录',
                'parentID'      =>      3,
                'controller'    =>      'Admin\MenuController@getAdd',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            [
                'id'            =>      5,
                'name'          =>      '修改目录',
                'parentID'      =>      3,
                'controller'    =>      'Admin\MenuController@getEdit',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            [
                'id'            =>      6,
                'name'          =>      '删除目录',
                'parentID'      =>      3,
                'controller'    =>      'Admin\MenuController@getDel',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            [
                'id'            =>      7,
                'name'          =>      'Ajax是否显示',
                'parentID'      =>      3,
                'controller'    =>      'Admin\MenuController@postDisplay',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            [
                'id'            =>      8,
                'name'          =>      '用户管理',
                'parentID'      =>      2,
                'controller'    =>      'Admin\AdminMemberController@getIndex',
                'listOrder'     =>      0,
                'display'       =>      1,
                'icon'          =>      ''
            ],
            [
                'id'            =>      9,
                'name'          =>      '添加用户',
                'parentID'      =>      8,
                'controller'    =>      'Admin\AdminMemberController@getAdd',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            [
                'id'            =>      10,
                'name'          =>      '修改用户',
                'parentID'      =>      8,
                'controller'    =>      'Admin\AdminMemberController@getEdit',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            [
                'id'            =>      11,
                'name'          =>      '删除用户',
                'parentID'      =>      8,
                'controller'    =>      'Admin\AdminMemberController@getDel',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            [
                'id'            =>      12,
                'name'          =>      '分组权限',
                'parentID'      =>      2,
                'controller'    =>      'Admin\AdminGroupController@getIndex',
                'listOrder'     =>      0,
                'display'       =>      1,
                'icon'          =>      ''
            ],
            [
                'id'            =>      13,
                'name'          =>      '添加分组',
                'parentID'      =>      12,
                'controller'    =>      'Admin\AdminGroupController@getAdd',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            [
                'id'            =>      14,
                'name'          =>      '修改分组',
                'parentID'      =>      12,
                'controller'    =>      'Admin\AdminGroupController@getEdit',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            [
                'id'            =>      15,
                'name'          =>      '删除分组',
                'parentID'      =>      12,
                'controller'    =>      'Admin\AdminGroupController@getDel',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            [
                'id'            =>      16,
                'name'          =>      '管理员权限',
                'parentID'      =>      12,
                'controller'    =>      'Admin\AdminGroupController@getGroupPermissions',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            [
                'id'            =>      22,
                'name'          =>      '后台设置',
                'parentID'      =>      2,
                'controller'    =>      'Admin\AdminSetController@getIndex',
                'listOrder'     =>      0,
                'display'       =>      1,
                'icon'          =>      ''
            ],
            [
                'id'            =>      23,
                'name'          =>      '添加',
                'parentID'      =>      22,
                'controller'    =>      'Admin\AdminSetController@getAdd',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            [
                'id'            =>      24,
                'name'          =>      '修改',
                'parentID'      =>      22,
                'controller'    =>      'Admin\AdminSetController@getEdit',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            [
                'id'            =>      25,
                'name'          =>      '删除',
                'parentID'      =>      22,
                'controller'    =>      'Admin\AdminSetController@getDel',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            [
                'id'            =>      26,
                'name'          =>      '后台日志',
                'parentID'      =>      2,
                'controller'    =>      'Admin\AdminLogController@getIndex',
                'listOrder'     =>      0,
                'display'       =>      1,
                'icon'          =>      ''
            ],
            [
                'id'            =>      27,
                'name'          =>      '查看日志',
                'parentID'      =>      26,
                'controller'    =>      'Admin\AdminLogController@getShow',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            /*
             * 会员管理
             */
            [
                'id'            =>      17,
                'name'          =>      '会员管理',
                'parentID'      =>      0,
                'controller'    =>      '',
                'listOrder'     =>      $order['member'],
                'display'       =>      1,
                'icon'          =>      'fa fa-users'
            ],
            [
                'id'            =>      18,
                'name'          =>      '用户管理',
                'parentID'      =>      17,
                'controller'    =>      'Admin\MemberController@getIndex',
                'listOrder'     =>      0,
                'display'       =>      1,
                'icon'          =>      ''
            ],
            [
                'id'            =>      19,
                'name'          =>      '添加会员',
                'parentID'      =>      18,
                'controller'    =>      'Admin\MemberController@getAdd',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            [
                'id'            =>      20,
                'name'          =>      '修改会员',
                'parentID'      =>      18,
                'controller'    =>      'Admin\MemberController@getEdit',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            [
                'id'            =>      21,
                'name'          =>      '删除会员',
                'parentID'      =>      18,
                'controller'    =>      'Admin\MemberController@getDel',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            /*
             * 我的面板
             */
            [
                'id'            =>      28,
                'name'          =>      '我的面板',
                'parentID'      =>      0,
                'controller'    =>      'Admin\MeController@getIndex',
                'listOrder'     =>      $order['me'],
                'display'       =>      1,
                'icon'          =>      'fa fa-user-secret'
            ],
            [
                'id'            =>      29,
                'name'          =>      '上传头像',
                'parentID'      =>      28,
                'controller'    =>      'Admin\MeController@postUpload',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            [
                'id'            =>      30,
                'name'          =>      '修改资料',
                'parentID'      =>      28,
                'controller'    =>      'Admin\MeController@postEdit',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            //后台用户上传头像
            [
                'id'            =>      31,
                'name'          =>      '上传头像',
                'parentID'      =>      8,
                'controller'    =>      'Admin\AdminMemberController@postUpload',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            //会员管理-上传头像
            [
                'id'            =>      32,
                'name'          =>      '上传头像',
                'parentID'      =>      18,
                'controller'    =>      'Admin\MemberController@postUpload',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            //会员分组管理
            [
                'id'            =>      33,
                'name'          =>      '分组管理',
                'parentID'      =>      17,
                'controller'    =>      'Admin\MemberGroupController@getIndex',
                'listOrder'     =>      0,
                'display'       =>      1,
                'icon'          =>      ''
            ],
            [
                'id'            =>      34,
                'name'          =>      '添加分组',
                'parentID'      =>      33,
                'controller'    =>      'Admin\MemberGroupController@getAdd',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            [
                'id'            =>      35,
                'name'          =>      '修改分组',
                'parentID'      =>      33,
                'controller'    =>      'Admin\MemberGroupController@getEdit',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            [
                'id'            =>      36,
                'name'          =>      '删除分组',
                'parentID'      =>      33,
                'controller'    =>      'Admin\MemberGroupController@getDel',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            /*
             * 商城管理
             */
            [
                'id'            =>      37,
                'name'          =>      '商城管理',
                'parentID'      =>      0,
                'controller'    =>      '',
                'listOrder'     =>      $order['shop'],
                'display'       =>      1,
                'icon'          =>      'fa fa-shopping-cart'
            ],
            //店铺管理
            [
                'id'            =>      38,
                'name'          =>      '店铺管理',
                'parentID'      =>      37,
                'controller'    =>      'Admin\Shop\StoreController@getIndex',
                'listOrder'     =>      0,
                'display'       =>      1,
                'icon'          =>      ''
            ],
            [
                'id'            =>      39,
                'name'          =>      '添加店铺',
                'parentID'      =>      38,
                'controller'    =>      'Admin\Shop\StoreController@getAdd',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            [
                'id'            =>      40,
                'name'          =>      '修改店铺',
                'parentID'      =>      38,
                'controller'    =>      'Admin\Shop\StoreController@getEdit',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            [
                'id'            =>      41,
                'name'          =>      '删除店铺',
                'parentID'      =>      38,
                'controller'    =>      'Admin\Shop\StoreController@getDel',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            //商品分发
            [
                'id'            =>      42,
                'name'          =>      '商品分发',
                'parentID'      =>      37,
                'controller'    =>      'Admin\Shop\StoreGoodsController@getIndex',
                'listOrder'     =>      0,
                'display'       =>      1,
                'icon'          =>      ''
            ],
            [
                'id'            =>      43,
                'name'          =>      '添加商品',
                'parentID'      =>      42,
                'controller'    =>      'Admin\Shop\StoreGoodsController@getAdd',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            [
                'id'            =>      44,
                'name'          =>      '修改商品',
                'parentID'      =>      42,
                'controller'    =>      'Admin\Shop\StoreGoodsController@getEdit',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            [
                'id'            =>      45,
                'name'          =>      '删除商品',
                'parentID'      =>      42,
                'controller'    =>      'Admin\Shop\StoreGoodsController@getDel',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            [
                'id'            =>      46,
                'name'          =>      '删除商品',
                'parentID'      =>      42,
                'controller'    =>      'Admin\Shop\StoreGoodsController@postDisplay',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            //商品分类
            [
                'id'            =>      47,
                'name'          =>      '商品分类',
                'parentID'      =>      37,
                'controller'    =>      'Admin\Shop\GoodsClassifyController@getIndex',
                'listOrder'     =>      0,
                'display'       =>      1,
                'icon'          =>      ''
            ],
            [
                'id'            =>      48,
                'name'          =>      '添加分类',
                'parentID'      =>      47,
                'controller'    =>      'Admin\Shop\GoodsClassifyController@getAdd',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            [
                'id'            =>      49,
                'name'          =>      '修改分类',
                'parentID'      =>      47,
                'controller'    =>      'Admin\Shop\GoodsClassifyController@getEdit',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            [
                'id'            =>      50,
                'name'          =>      '删除分类',
                'parentID'      =>      47,
                'controller'    =>      'Admin\Shop\GoodsClassifyController@getDel',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            //商品管理
            [
                'id'            =>      51,
                'name'          =>      '商品管理',
                'parentID'      =>      37,
                'controller'    =>      'Admin\Shop\GoodsController@getIndex',
                'listOrder'     =>      0,
                'display'       =>      1,
                'icon'          =>      ''
            ],
            [
                'id'            =>      52,
                'name'          =>      '增加商品',
                'parentID'      =>      51,
                'controller'    =>      'Admin\Shop\GoodsController@getAdd',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            [
                'id'            =>      53,
                'name'          =>      '修改商品',
                'parentID'      =>      51,
                'controller'    =>      'Admin\Shop\GoodsController@getEdit',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            [
                'id'            =>      54,
                'name'          =>      '删除商品',
                'parentID'      =>      51,
                'controller'    =>      'Admin\Shop\GoodsController@getDel',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            [
                'id'            =>      55,
                'name'          =>      '上传缩略图',
                'parentID'      =>      51,
                'controller'    =>      'Admin\Shop\GoodsController@postUpload',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            //订单管理
            [
                'id'            =>      56,
                'name'          =>      '订单管理',
                'parentID'      =>      37,
                'controller'    =>      'Admin\Shop\OrderController@getIndex',
                'listOrder'     =>      0,
                'display'       =>      1,
                'icon'          =>      ''
            ],
            [
                'id'            =>      57,
                'name'          =>      '修改订单',
                'parentID'      =>      56,
                'controller'    =>      'Admin\Shop\OrderController@getEdit',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            [
                'id'            =>      58,
                'name'          =>      '修改配送状态',
                'parentID'      =>      56,
                'controller'    =>      'Admin\Shop\OrderController@postLogisticsState',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            [
                'id'            =>      59,
                'name'          =>      '导出Excel',
                'parentID'      =>      56,
                'controller'    =>      'Admin\Shop\OrderController@getExcel',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ],
            [
                'id'            =>      60,
                'name'          =>      '导出打印Excel',
                'parentID'      =>      56,
                'controller'    =>      'Admin\Shop\OrderController@getExcelPrint',
                'listOrder'     =>      0,
                'display'       =>      0,
                'icon'          =>      ''
            ]
        ];
        foreach ($data as $v)
        {
            \App\Models\AdminMenu::create($v);
        }
    }
}
